﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<ThanhCongJSC.Models.Content>" %>
<%@ Import Namespace="ThanhCongJSC.Helper"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Trang cap nhat tuyen dung
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="CssJsRef" runat="server">
    <link rel="stylesheet" type="text/css" href="<%= Application["Root"]%>/Content/css/jquery-ui-1.8.16.custom.css" /> 
    
    <script type='text/javascript' language='javascript' src='<%= Url.Content("~/ckeditor/ckeditor.js") %>'></script>
    <script type='text/javascript' language='javascript' src='<%= Url.Content("~/Scripts/jquery-ui-1.8.16.custom.min.js") %>'></script>
    
    <script type="text/javascript">
        jQ(function() {
            jQ("#tabs").tabs({ fx: [{ opacity: 'toggle', duration: 'normal' },   // hide option
                        {opacity: 'toggle', duration: 'fast'}]
            });
        });

        function Cancel() {
            window.location = '/Admin/NewsManagement/' + '<%= Constant.QueryStringTinTucDuAn %>';
        }

        function Validate() {
            var errorMsg = "";
//            var content = jQ("#ContentDetail").val();
//            if (content == '') {
//                jQ("#error-content").html("Nội dung tiếng Việt không được bỏ trống");
//                return false;
//            }

            return true;
        }

        function Submit() {
            if (Validate())
                document.forms[0].submit();
        }
	</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Cập nhật thông tin <b><%= Model.ContentTitle%></b></h2>
    
    <% Html.EnableClientValidation(); %> 
        <% using (Html.BeginForm("RecruitManagement", "Admin", FormMethod.Post, new { id = "form-news", enctype = "multipart/form-data" }))
           {%>
            <div id="content-detail">
                <div id="tabs">
	                <ul>
		                <li><a href="#content-vn">Nội dung tiếng Việt</a></li>
		                <li><a href="#content-en">Nội dung tiếng Anh</a></li>
	                </ul>
        	        
	                <div id="content-vn">
  	                    <p>
	                        <label><b>Nội dung</b></label>
	                        <br />
	                        <%= Html.TextAreaFor(b => b.ContentDetail) %>
	                        <span id="error-content" style="color:#FF0000"></span>
	                        <script type="text/javascript">
	                            CKEDITOR.replace('ContentDetail',
                                {
                                    width: 800,
                                    height: 500,
                                    toolbarCanCollapse: false,
                                    removePlugins: 'elementspath',
                                    uiColor: '#DCDCDC',
                                    filebrowserImageBrowseUrl: '/ckeditor/ImageBrowser.aspx?ImageFolderRoot=~/Content/images_tuyendung/'
                                });
	                        </script>
	                    </p> 
	                </div>
        	        
    	            <!-- noi dung tieng anh -->
	                <div id="content-en">
	                    <p>
	                        <label><b>Nội dung</b></label>
	                        <br />
	                        <%= Html.TextAreaFor(b => b.ContentDetail2) %>
	                        <script type="text/javascript">
	                            CKEDITOR.replace('ContentDetail2',
                                {
                                    width: 800,
                                    height: 500,
                                    toolbarCanCollapse: false,
                                    removePlugins: 'elementspath',
                                    uiColor: '#DCDCDC',
                                    filebrowserImageBrowseUrl: '/ckeditor/ImageBrowser.aspx?ImageFolderRoot=~/Content/images_tuyendung/'
                                });
	                        </script>
	                    </p>	            
	                </div>
                </div>
            </div>
            
            <br />
            <input type="button" class="button" value="Lưu lại" onclick="Submit()"/> &nbsp;&nbsp;&nbsp;
            <input type="button" class="button" value="Hủy bỏ" onclick="Cancel()" />
            
            <%= Html.HiddenFor(b=>b.ContentID) %>
        <%} %>
</asp:Content>


